<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Update Title</title>
    <link rel="stylesheet" th:href="@{/css/plugins/layui/css/layui.css}" >
    <style>
        body {
            padding: 10px;
        }
    </style>
</head>
<body>
<div class="layui-form" th:object="${permission}">
    <input type="hidden" id="id" th:field="*{id}">
    <!-- 权限名称 -->
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">权限名称</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="update_menuName"  th:field="*{menuName}" class="layui-input">
            </div>
        </div>
    </div>
    <!-- 菜单类型 -->
    <div class="layui-form-item">
        <input type="hidden" id="update_menuType" th:field="*{menuType}" value="">
        <label class="layui-form-label">菜单类型</label>
        <div class="layui-input-block">
            <input type="radio" lay-filter="update_menuType-filter" th:field="*{menuType}" name="update_menuType" value="M" class="layui-input" title="目录">
            <input type="radio" lay-filter="update_menuType-filter" th:field="*{menuType}" name="update_menuType" value="C" class="layui-input" title="菜单">
            <input type="radio" lay-filter="update_menuType-filter" th:field="*{menuType}" name="update_menuType" value="F" class="layui-input" title="按钮">
        </div>
    </div>
    <!-- 父级菜单 -->
    <div class="layui-form-item" id="update_pIdFormItem" th:if="${permission.menuType!= 'M'}">
        <label class="layui-form-label">父级菜单</label>
        <div class="layui-input-inline layui-input-wrap">
            <select id="update_pId" th:field="*{parentId}" th:with="parentMenus=${@permissionService.list()}">
                <option value="">请选择</option>
                <option th:each="pm : ${parentMenus}" th:text="${pm.menuName}" th:value="${pm.id}" th:selected="${parentPermission!= null && pm.id == parentPermission.id}"></option>
            </select>
        </div>
    </div>
    <!-- 请求地址 -->
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">请求地址</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="update_url" th:field="*{url}" name="update_url" class="layui-input">
            </div>
        </div>
    </div>
    <!-- 权限标识 -->
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">权限标识</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="update_perms" th:field="*{perms}" name="update_perms" class="layui-input">
            </div>
        </div>
    </div>
</div>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/plugins/layui/layui.js}"></script>
</body>
</html>